package main.java.responsibility;

/**
 * 责任链模式
 */
public class Demo {
    public static void main(String[] args) {
        LeaveRequest leaveRequest = new LeaveRequest("张三", 3, "病假");

        GroupLeader groupLeader = new GroupLeader();

        Manager manager = new Manager();
        GeneralManager generalManager = new GeneralManager();

        //设置处理者链

        groupLeader.setNexHandler(manager);
        manager.setNexHandler(generalManager);


        groupLeader.submit(leaveRequest);
    }
}
